package com.baizan.daka.ui.adapter


import android.graphics.Color
import android.widget.TextView
import com.baizan.daka.mvp.model.bean.ShowCashBean
import com.baizan.daka.util.TimeUtil
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.BaseViewHolder
import com.dianzan.daka.R
import java.text.SimpleDateFormat

class ShowCashAdapter : BaseQuickAdapter<ShowCashBean, BaseViewHolder>(R.layout.item_showcash) {


    override fun convert(helper: BaseViewHolder, item: ShowCashBean) {//#FF9211
       val  status =helper.getView<TextView>(R.id.status_value_tv)
        val  money= helper.getView<TextView>(R.id.money_value_tv)
        val  time = helper.getView<TextView>(R.id.showcash_time_value_tv)

        time.text = TimeUtil.transToYMdHm(TimeUtil.transToTimeStamp(item.createTime))
        money.text = "${item.amount}元"
        status.text = item.auditStateName
        when(item.auditState){
            1 -> {
                status.setTextColor(Color.parseColor("#FF9211"))
            }
            2 -> {
                status.setTextColor(Color.parseColor("#0D77FE"))
                status.text = "成功"
            }
            3 -> {
                status.setTextColor(Color.parseColor("#999999"))
            }
        }

    }


}